package com.csht.mapper;

import java.util.Map;

import com.csht.model.CshtUser;

public interface CshtUserMapper {
	
	/**
	 * 根据用户名查找用户
	 * @param username
	 * @return
	 * @throws Exception
	 */
	public CshtUser getUserByUsername(String username) throws Exception;
	
	/**
	 * 用户注册
	 * @param cshtUser
	 * @throws Exception
	 */
	public void userRegister(CshtUser cshtUser) throws Exception;
	
	/**
	 * 根据手机号查找用户
	 * @param username
	 * @return
	 * @throws Exception
	 */
	public CshtUser findUserByTel(String userTel) throws Exception;
	
	/**
	 * 根据电话修改用户名
	 * @param userTel
	 * @param username
	 * @throws Exception
	 */
	public void updateUsername(CshtUser cshtUser) throws Exception;
	
	/**
	 * 根据手机号修改用户密码
	 * @param cshtUser
	 * @throws Exception
	 */
	public void updatePassword(CshtUser cshtUser) throws Exception;
	
	/**
	 * 根据用户id查找用户
	 * @return
	 * @throws Exception
	 */
	public CshtUser getUserByUserId(Integer userId) throws Exception;
	
	/**
	 * 根据用户名或手机号查找用户
	 * @param usernameOrTel
	 * @return
	 * @throws Exception
	 */
	public CshtUser getUserByUsernameOrTel(String usernameOrTel) throws Exception;
	
	/**
	 * 更新登录失败次数
	 * @param cahtUser
	 * @throws Exception
	 */
	public void updateLoginFailTime(CshtUser cshtUser) throws Exception;
	
	/**
	 * 根据用户id修改头像
	 * @param fileNameAndUserId
	 * @throws Exception
	 */
	public void updateUserHeadById(Map<String, String> fileNameAndUserId) throws Exception;
	
	/**
	 * 根据用户id修改用户名
	 * @param userIdAndUsername
	 * @throws Exception
	 */
	public void updateUsernameById(Map<String, String> userIdAndUsername) throws Exception;
	
	/**
	 * 根据用户id修改密码
	 * @param userIdAndUserPassword
	 * @throws Exception
	 */
	public void updateUserPasswordById(Map<String, String> userIdAndUserPassword) throws Exception;
	
	/**
	 * 根据用户id修改地址
	 * @param userIdAndAddress
	 * @throws Exception
	 */
	public void updateUserAddressById(Map<String, String> userIdAndAddress) throws Exception;
	
	/**
	 * 根据用户id修改用户性别
	 * @param userIdAndGender
	 * @throws Exception
	 */
	public void updateUserGenderById(Map<String, String> userIdAndGender) throws Exception;
	
	/**
	 * 根据用户id修改QQ号
	 * @param userIdAnduserqq
	 * @throws Exception
	 */
	public void updateUserqqById(Map<String, String> userIdAnduserqq) throws Exception;
	
	/**
	 * 根据用户id修改微信号
	 * @param userIdAndUserWechat
	 * @throws Exception
	 */
	public void updateUserWechatById(Map<String, String> userIdAndUserWechat) throws Exception;
    
}